home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / fortran / f2c_src.zip / F2C / LIBI77 / REWIND.C < prev    next >
C/C++ Source or Header  |  1991-06-10  |  370b  |  21 lines

  1. #include "f2c.h"
  2. #include "fio.h"
  3. integer f_rew(a) alist *a;
  4. {
  5.     unit *b;
  6.     if(a->aunit>=MXUNIT || a->aunit<0)
  7.         err(a->aerr,101,"rewind");
  8.     b = &units[a->aunit];
  9.     if(b->ufd == NULL || b->uwrt == 3)
  10.         return(0);
  11.     if(!b->useek)
  12.         err(a->aerr,106,"rewind")
  13.     if(b->uwrt) {
  14.         (void) t_runc(a);
  15.         b->uwrt = 3;
  16.         }
  17.     rewind(b->ufd);
  18.     b->uend=0;
  19.     return(0);
  20. }
  21.